﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UI.Desktop
{
    public partial class frmReporteTurnos : Form
    {
        public frmReporteTurnos()
        {
            InitializeComponent();
        }

        private void frmReporteTurnos_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'DataSet2.ViPacProfTur' table. You can move, or remove it, as needed.
        //    this.ViPacProfTurTableAdapter.Fill(this.DataSet2.ViPacProfTur);



            //this.reportViewer1.RefreshReport();
            //this.reportViewer1.RefreshReport();
            //this.reportViewer1.RefreshReport();
            //this.reportViewer1.RefreshReport();
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void btnEmitir_Click(object sender, EventArgs e)
        {
            Business.Entities.Profesional prof = new Business.Entities.Profesional();
            Business.Entities.Turno Entur = new Business.Entities.Turno();
            string Concatenado = cbProfesional.Text;
            DataSet dsProf = new DataSet();
            DataSet dsTurnos = new DataSet();
            dsProf = prof.ObtenerProfesional(Concatenado);
            string id_profesional = dsProf.Tables["Profesional"].Rows[0][0].ToString();
            dsTurnos= Entur.ObtenerReporte(id_profesional);
            
            
            
            
            

        }

        private void cbProfesional_Click(object sender, EventArgs e)
        {
            Business.Entities.Profesional prof = new Business.Entities.Profesional();
            DataSet dsProf = new DataSet();
            dsProf = prof.ObtenerListaProfesional();
            ObtenerProfesional(dsProf);
        }


        private void ObtenerProfesional(DataSet dsProf)
        {
            cbProfesional.Text = "Seleccione el profesional";
            cbProfesional.DataSource = dsProf.Tables["Profesional"];
            string Id_profesional = dsProf.Tables["Profesional"].Columns[0].Caption.ToString();
            string concatenado = dsProf.Tables["Profesional"].Columns[0].Caption.ToString();



            cbProfesional.DisplayMember = concatenado;



        }

        private void reportViewer1_Load(object sender, EventArgs e, DataSet dsTurnos )
        {   
          
        }

        

    
    
    
    }
}
